package adv5;

import java.text.SimpleDateFormat;
import java.util.Calendar;

public class XueShiHouTest {

	public static void main(String[] args) {
		SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd-a HH点");
		Calendar cal = Calendar.getInstance();
		for (int j = 1; j <= 12; j++) {
			cal.set(Calendar.MONTH, j - 1);
			cal.set(Calendar.HOUR_OF_DAY, 8);
			// cal.set(2017, Calendar.MONTH, j - 1);
			int maxDate = cal.getActualMaximum(Calendar.DATE);
			int saturdays = 0;
			for (int i = maxDate; i > 0; i--) {
				cal.set(Calendar.DATE, i);
				// 判断周六

				if (cal.get(Calendar.DAY_OF_WEEK) == Calendar.SATURDAY) {
					saturdays++;
				}
				if (saturdays == 2) {
					break;
				}
			}

			String s = df.format(cal.getTime());
			System.out.println(j + "月的学士后考试时间是" + s);
		}

	}

}
